#include <stdio.h>
#include "dbg.h"

int collatz(int n)
{
	while(n != 1)
	{
		printf("%d ", n);
		if(n % 2)
			n = n * 3 + 1;
		else
			n /= 2;
	}
	printf("%d\n", n);
}

int main(int argc, char *argv[])
{
	int n;
	printf("Please input an Int:");
	int in = scanf("%d",&n);
	check(in,"输入非整数");
	printf("\n");
	collatz(n);
	return 0;
error:
	return -1;
}
